﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraReports.UI;

namespace GE_Management_Tool.Reporting
{
    public partial class frmReporting : DevExpress.XtraEditors.XtraUserControl
    {
        public frmReporting()
        {
            InitializeComponent();
        }

        private void btnShow_Click(object sender, EventArgs e)
        {
            try
            {
                switch(cbbReport.SelectedIndex)
                {
                    case 0: 
                        rptTaskReporting v_rpt = new rptTaskReporting();
                        Load_Report(v_rpt);
                        break;
                }

            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "Warning", MessageBoxButtons.OK);
            }
        }

        private void Load_Report(XtraReport p_objReport)
        {
            p_objReport.CreateDocument();
            printControl1.PrintingSystem = p_objReport.PrintingSystem;
        }
    }
}
